#include <bits/stdc++.h>

using namespace std;

const int N = 1010;
int n;
struct node
{
    int t;
    int id;
}a[N];

bool cmp(node &x , node &y)
{
    return x.t < y.t;
}
int main()
{
    cin >> n;
    for(int i = 1;i <= n;i ++)
    {
        cin >> a[i].t;
        a[i].id = i;
    }

    sort(a + 1 , a + 1 + n , cmp);
    double sum = 0 , wait = 0;
    for(int i = 1;i <= n;i ++)
    {
        cout << a[i].id << " ";
        sum += wait;
        wait += a[i].t;
    }
    cout << endl;
    printf("%.2lf" , sum / n);
    return 0;
}